package study.method.base;

/**
 * 值传递和引用传递
 * @author Administrator
 * @date 2020/12/9
 */
public class MethodDemo02 {
    public static void change(Person person){
        person.setName("大东");
    }

    public static void main(String[] args) {
        Person person = new Person();
        //直接调用person.name,name为null所以直接返回null
        System.out.println(person.getName());
        //引用方法给对象传递值
        change(person);
        System.out.println(person.getName());
    }
}

